package com.tc168.cp306.b06.gen;

import java.util.Map;

import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.AbstractDaoSession;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.identityscope.IdentityScopeType;
import org.greenrobot.greendao.internal.DaoConfig;

import com.tc168.cp306.b06.bean.User;
import com.tc168.cp306.b06.bean.TopicAnswerbean;
import com.tc168.cp306.b06.bean.Topticbean;
import com.tc168.cp306.b06.bean.UserAnswerbean;

import com.tc168.cp306.b06.gen.UserDao;
import com.tc168.cp306.b06.gen.TopicAnswerbeanDao;
import com.tc168.cp306.b06.gen.TopticbeanDao;
import com.tc168.cp306.b06.gen.UserAnswerbeanDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see org.greenrobot.greendao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig userDaoConfig;
    private final DaoConfig topicAnswerbeanDaoConfig;
    private final DaoConfig topticbeanDaoConfig;
    private final DaoConfig userAnswerbeanDaoConfig;

    private final UserDao userDao;
    private final TopicAnswerbeanDao topicAnswerbeanDao;
    private final TopticbeanDao topticbeanDao;
    private final UserAnswerbeanDao userAnswerbeanDao;

    public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        userDaoConfig = daoConfigMap.get(UserDao.class).clone();
        userDaoConfig.initIdentityScope(type);

        topicAnswerbeanDaoConfig = daoConfigMap.get(TopicAnswerbeanDao.class).clone();
        topicAnswerbeanDaoConfig.initIdentityScope(type);

        topticbeanDaoConfig = daoConfigMap.get(TopticbeanDao.class).clone();
        topticbeanDaoConfig.initIdentityScope(type);

        userAnswerbeanDaoConfig = daoConfigMap.get(UserAnswerbeanDao.class).clone();
        userAnswerbeanDaoConfig.initIdentityScope(type);

        userDao = new UserDao(userDaoConfig, this);
        topicAnswerbeanDao = new TopicAnswerbeanDao(topicAnswerbeanDaoConfig, this);
        topticbeanDao = new TopticbeanDao(topticbeanDaoConfig, this);
        userAnswerbeanDao = new UserAnswerbeanDao(userAnswerbeanDaoConfig, this);

        registerDao(User.class, userDao);
        registerDao(TopicAnswerbean.class, topicAnswerbeanDao);
        registerDao(Topticbean.class, topticbeanDao);
        registerDao(UserAnswerbean.class, userAnswerbeanDao);
    }
    
    public void clear() {
        userDaoConfig.clearIdentityScope();
        topicAnswerbeanDaoConfig.clearIdentityScope();
        topticbeanDaoConfig.clearIdentityScope();
        userAnswerbeanDaoConfig.clearIdentityScope();
    }

    public UserDao getUserDao() {
        return userDao;
    }

    public TopicAnswerbeanDao getTopicAnswerbeanDao() {
        return topicAnswerbeanDao;
    }

    public TopticbeanDao getTopticbeanDao() {
        return topticbeanDao;
    }

    public UserAnswerbeanDao getUserAnswerbeanDao() {
        return userAnswerbeanDao;
    }

}
